Skip to content

[Main] Item tracking validation when lot numbers are assigned concerns the warehouse pick level rather than at the sales order levelInitial Commit - #9982

Open
Shikhverma wants to merge 13 commits into
mainfrom
bugs/Bug-638344-Master-ItemTrackingValidationWhenLotNumbersAreAssigned
Open

[Main] Item tracking validation when lot numbers are assigned concerns the warehouse pick level rather than at the sales order levelInitial Commit#9982
Shikhverma wants to merge 13 commits into
mainfrom
bugs/Bug-638344-Master-ItemTrackingValidationWhenLotNumbersAreAssigned

Conversation

@Shikhverma

@Shikhverma Shikhverma commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Bug 646429: [master] [REPAIR] [ALL-E] Item tracking validation when lot numbers are assigned concerns the warehouse pick level rather than at the sales order level

Fixes AB#646429

@github-actions github-actions Bot added the SCM GitHub request for SCM area label Aug 5, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 5, 2026
Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com>
@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Aug 6, 2026
@Shikhverma Shikhverma removed the needs-approval Workflow runs require maintainer approval to start label Aug 6, 2026
@Shikhverma Shikhverma closed this Aug 7, 2026
@Shikhverma Shikhverma reopened this Aug 7, 2026
@Shikhverma

Copy link
Copy Markdown
Contributor Author

Copilot resolve the merge conflicts in this pull request

…r-ItemTrackingValidationWhenLotNumbersAreAssigned

Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com>

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

Resolved by merging main into this branch (534f0c7). The merge completed cleanly with no manual conflict resolution needed — git's rename detection handled the upstream reorganization of the SCM test directories, and both files added in this PR are preserved with unchanged content in their new SCM-Reservation locations.

@Shikhverma Shikhverma closed this Aug 9, 2026
@Shikhverma Shikhverma reopened this Aug 9, 2026
@Shikhverma
Shikhverma marked this pull request as ready for review August 9, 2026 07:07
@Shikhverma
Shikhverma requested a review from a team August 9, 2026 07:07
Comment thread src/Layers/W1/BaseApp/Inventory/Tracking/ItemTrackingDataCollection.Codeunit.al Outdated
…gisteredWhsePickAllocation test

Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com>
Comment thread src/Layers/RU/Tests/SCM-Reservation/SCMItemTracking.Codeunit.al
@Shikhverma
Shikhverma enabled auto-merge August 18, 2026 04:31
@Shikhverma Shikhverma closed this Aug 18, 2026
auto-merge was automatically disabled August 18, 2026 04:31

Pull request was closed

@Shikhverma Shikhverma reopened this Aug 18, 2026
Comment thread src/Layers/RU/Tests/SCM-Reservation/SCMItemTracking.Codeunit.al
Comment thread src/Layers/W1/Tests/SCM-Reservation/SCMItemTracking.Codeunit.al
@Shikhverma
Shikhverma enabled auto-merge August 18, 2026 07:19
@Shikhverma Shikhverma closed this Aug 18, 2026
auto-merge was automatically disabled August 18, 2026 08:06

Pull request was closed

@Shikhverma Shikhverma reopened this Aug 18, 2026
@Shikhverma Shikhverma closed this Aug 18, 2026
@Shikhverma Shikhverma reopened this Aug 18, 2026
@Shikhverma Shikhverma closed this Aug 19, 2026
@Shikhverma Shikhverma reopened this Aug 19, 2026
@Shikhverma
Shikhverma requested review from a team as code owners August 19, 2026 04:05
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 7

Recommendation: Accept

What this PR does

This PR makes lot availability exclude quantities already committed on unregistered warehouse and inventory picks, so the same tracked lot is not double-promised to another sales demand. The core change is in codeunit 6501 "Item Tracking Data Collection", with matching W1 and RU regression tests.

The only change since round 6 is in the RU test: CreateLotTrackedItemAtLocation now calls LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location) instead of CreateLocation(Location). This aligns the RU test setup with the W1 test, which already uses the same helper. The following InventoryPostingSetup.Get guard still prevents duplicate setup, so the change is safe. No production code changed this round.

Status of previous suggestions
ID Title Status Author response
S1 Inventory picks still look available Addressed Invt. Pick added to the activity-type filter plus inventory-pick regression tests; unchanged this round.
S2 Limit loaded warehouse activity fields Addressed SetLoadFields(...) added before the warehouse activity FindSet(); unchanged this round.
New observations (commits since round 6)

No new issues found in the latest commits. The single change is a test-only setup alignment (using a location helper that also creates the inventory posting setup) and improves consistency between the RU and W1 tests.

Risk assessment and necessity

Risk: None added this round. The change touches only RU test setup, not the shipped item tracking logic. The data-integrity path in codeunit 6501 (same item, variant, location, tracked pick lines, positive outstanding quantity, different source) is unchanged and still covered by the W1 and RU tests, so the moved validation still fires at the pick level rather than silently skipping.

Necessity: The bug is valid and important: a lot already allocated on an unregistered pick could otherwise still look available. The test change is a small consistency improvement and keeps the RU location setup on par with W1.


[AI-PR-REVIEW] version=1 promptVersion=2 system=github pr=9982 round=7 by=alexei-dobriansky at=2026-08-19T18:04:29Z lastSha=4f9c51f62ac90011f949c79dc0202657a02a9d6d reviewKey=06fbcc52b5a2bec8146c74884781efdd046478dfef7cf9000b6cc3237e0adf2f suggestions=S1@7e12c54f:addressed,S2@e5f33065:addressed parentRound=6

@Shikhverma
Shikhverma requested a review from a team August 21, 2026 05:11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S1: The new unregistered-pick request can double-count demand already represented by reservation entries. Existing item-tracking reservation entries are transferred and summarized earlier in the calculation, then every tracked unregistered pick from another source is added again at ItemTrackingDataCollection.Codeunit.al:579. In the normal source-line-tracking flow, the reservation and warehouse pick represent the same allocation, which can incorrectly make an available lot appear unavailable.

Please deduplicate the warehouse request against the transferred reservation and add a production-flow regression test that assigns source-line tracking before creating the pick. The current tests fabricate an item ledger entry and warehouse activity line without the corresponding reservation entry, so they cannot detect this interaction. All reported CI checks passed, but this remains a high-risk functional regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants